Skip to content

blockdev: Restore multipath partition number fallback from device path#2219

Merged
ckyrouac merged 1 commit into
bootc-dev:mainfrom
ckyrouac:blockdev-multi-fix
Jun 2, 2026
Merged

blockdev: Restore multipath partition number fallback from device path#2219
ckyrouac merged 1 commit into
bootc-dev:mainfrom
ckyrouac:blockdev-multi-fix

Conversation

@ckyrouac
Copy link
Copy Markdown
Collaborator

@ckyrouac ckyrouac commented May 29, 2026

When the sysfs partition attribute is missing on multipath devices and lsblk's partn field is also unavailable, fall back to extracting trailing digits from the ESP device path (e.g. /dev/mapper/mpatha2"2"). This restores the behavior originally added in bootupd PR #1006 that was lost during the migration to the bootc-internal-blockdev crate.

Assisted-by: Claude Code

@bootc-bot bootc-bot Bot requested a review from jeckersb May 29, 2026 18:31
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a fallback mechanism to get_esp_partition_number that extracts the partition number from the ESP device path relative to the parent path when standard attributes are missing. The review feedback suggests making the suffix parsing more robust by ensuring only leading digits are extracted (ignoring any trailing non-digit characters like UUIDs) and adding corresponding unit tests.

Comment thread crates/blockdev/src/blockdev.rs
Comment thread crates/blockdev/src/blockdev.rs
if let Some(partn) = esp_device.partn {
return Ok(partn.to_string());
}
// Last resort: strip the parent device path from the ESP device path,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm....I'm OK with this but I wonder if there's not some way we can actually find the data by looking at the multipath data?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth looking into KNAME output of the lsblk command

@travier
Copy link
Copy Markdown
Contributor

travier commented Jun 1, 2026

Title comment/commit should be updated to reference the full URL for coreos/bootupd#1006 to not have it point to the bootc repo.

@joelcapitao joelcapitao mentioned this pull request Jun 1, 2026
41 tasks
When the sysfs `partition` attribute is missing on multipath devices and
lsblk's `partn` field is also unavailable, fall back to extracting
trailing digits from the ESP device path (e.g. `/dev/mapper/mpatha2` →
`"2"`). This restores the behavior originally added in bootupd PR
[bootc-dev#1006](coreos/bootupd#1006)
that was lost during the migration to the bootc-internal-blockdev crate.

Assisted-by: Claude Code
Signed-off-by: ckyrouac <ckyrouac@redhat.com>
@ckyrouac ckyrouac force-pushed the blockdev-multi-fix branch from 094b918 to 3a4b486 Compare June 2, 2026 14:28
@ckyrouac ckyrouac enabled auto-merge June 2, 2026 14:29
@ckyrouac ckyrouac added this pull request to the merge queue Jun 2, 2026
Merged via the queue into bootc-dev:main with commit 9c3e439 Jun 2, 2026
14 checks passed
@ckyrouac ckyrouac deleted the blockdev-multi-fix branch June 2, 2026 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants